//
//  YHOptionTableViewItem.m
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/28.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHOptionTableViewItem.h"
#import "YHBaseTableViewCell.h"

#import "YHOptionTitleTableViewCell.h"


@implementation YHOptionTableViewItem

-(void)yh_commonInit{
    
    self.layout = [YHOptionTableViewLayout new];
    
    self.cellClass = YHBaseTableViewCell.class;
    self.cellIdentify = YHBaseTableViewCell.cellIndentify;
    
    self.isRequire = YES;
    self.changeShouldReload = YES;
    
    self.leftContent = [YHOptionTableViewSubContent new];
    self.rightContent = [YHOptionTableViewSubContent new];
}

- (void)layoutConfig:(void(^)(YHOptionTableViewLayout * passLayout))config{
    if(config){
        config(self.layout);
    }
}

/// 判断是否满足条件 不满足弹窗提示
- (BOOL)isAviableToHint{
    return YES;
}

@end


@implementation YHOptionTableViewSubContent

- (void)clean{
    self.imageURL = nil;
    
    self.isOn = NO;
    
    self.title = nil;
    self.attibutedTitle = nil;
}

- (BOOL)isNull{
    if(IsNull(self.title) ||
       IsNull(self.attibutedTitle)){
        return YES;
    }
    return NO;
}
@end
